//
// Created by ChaoDONG on 2021-03-24.
//

// glue.c -- use the ## operator

#include <stdio.h>

#define XNAME(n) x ## n
/* ##还可用于对象宏的替换部分。##运算符把两个记号组合成一个记号 */
#define PRINT_XN(n) printf("x" #n " = %d\n", x ## n);

int main(void)
{
    int XNAME(1) = 14; // becomes int x1 = 14;
    int XNAME(2) = 20; // becomes int x2 = 20;
    int x3 = 30;
    PRINT_XN(1); // becomes printf("x1 = %d\n", x1);
    PRINT_XN(2); // becomes printf("x2 = %d\n", x2);
    PRINT_XN(3); // becomes printf("x3 = %d\n", x3);
    return 0;
}